package com.itheima.Test_课上作业.修饰符.权限修饰符.test1;

public class Fu {
    //private: 私有权限,仅限于本类中访问.
    private String name = "东方不败";
    //不写权限,表示默认权限,支持同一个包下的类进行访问
    int age = 999;
    //protected: 受保护权限,支持同一个包下的类进行访问及跨包子类访问
    protected double height = 5.56;
    //public : 公共权限, 支持任意类访问
    public double weight = 7.62;

    public void method(){
        System.out.println(name);
        System.out.println(age);
        System.out.println(height);
        System.out.println(weight);
    }
}
//同包子类
class Zi extends Fu{
    public  void method(){
        //System.out.println(super.name);//private: 私有权限,仅限于本类中访问.
        System.out.println(age);
        System.out.println(this.height);
        System.out.println(this.weight);
    }
}

